$(function() {
    window.onload = function() {
        document.oncontextmenu = function() {
            window.event.returnValue = false;
        };
    }
//    $('#menu').menu({
//                onHide : function() {
//                    // optNode = null;
//                }
//            });
    // var kkkk =
    // '[{"id":"1","text":"电研莱科","state":"closed","attributes":{"parentId":"","id":"1","isEmp":"0","orgName":"电研莱科","orgState":"0","orgType":"0","displayOrder":1}}]';
 

	    $('#orgTree').tree({
			url : ctx+'/admin/organization!currOrg.action',
			onContextMenu : function(e, node) { // 菜单 打开
				// $('#orgTree').tree("select", optNode.target);
				showMenu(node.target);
			},
			onClick:function(node){//查看、修改
				
			}
		});
});

// 右击显示菜单
function showMenu(obj) {
	alert($(obj).html());
	var offset = $(obj).offset();
	$('#menu').menu('show',{
		top:offset.top+20,
		left:offset.left+20
	});
}